package a.h;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.HashMap;
import java.util.Map;

class j
  extends i
  implements lb.c_
{
  static final String w = "JTextFieldColorEditor.useIconAsTrigger";
  static final String x = "JTextFieldColorEditor.buttonIsFocusable";
  static final String y = "JTextFieldColorEditor.showIcon";
  private static final String z = "JTextFieldColorEditor.leftAlignedPopup";
  private final ob A;
  private final ab B;
  static Class C;
  
  j(ic paramic, ob paramob, Map paramMap, c_ paramc_)
  {
    super(paramic, paramMap, paramc_);
    ab localab = null;
    if (paramMap != null)
    {
      if (i == 0) {
        if (Boolean.FALSE.equals(paramMap.get("JTextFieldColorEditor.buttonIsFocusable"))) {
          this.q.a().setFocusable(false);
        }
      }
      if (i == 0) {
        if (paramMap.containsKey("JTextFieldColorEditor.useIconAsTrigger"))
        {
          if (i != 0) {
            break label156;
          }
          if (!Boolean.TRUE.equals(paramMap.get("JTextFieldColorEditor.useIconAsTrigger"))) {
            break label142;
          }
          this.q.remove(1);
          if (i != 0) {
            break label156;
          }
          if (!bool) {
            break label142;
          }
        }
      }
      if (i == 0) {
        if (Boolean.TRUE.equals(paramic.c("JTextFieldColorEditor.useIconAsTrigger"))) {
          this.q.remove(1);
        }
      }
      label142:
      if (Boolean.TRUE.equals(paramMap.get("JTextFieldColorEditor.showIcon")))
      {
        label156:
        localab = new ab((Color)paramic.o());
        Object localObject;
        if (this.q.getComponentCount() == 1)
        {
          localObject = new JButton();
          ((JButton)localObject).setActionCommand("JTextFieldColorEditor.leftAlignedPopup");
          ((JButton)localObject).setIcon(localab);
          ((JButton)localObject).setIconTextGap(0);
          ((JButton)localObject).setOpaque(false);
          ((JButton)localObject).setMargin(new Insets(0, 0, 0, 0));
          ((JButton)localObject).setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 3));
          ((JButton)localObject).setFocusable(false);
          this.q.add((Component)localObject, "West");
          if (i != 0) {
            return;
          }
          if (!bool) {}
        }
        else
        {
          localObject = new JLabel(localab);
          ((JLabel)localObject).setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 3));
          this.q.add((Component)localObject, "West");
        }
      }
    }
    this.q.a(i());
    this.A = paramob;
    this.B = localab;
  }
  
  protected void h()
  {
    super.h();
    lb.b((Color)n());
  }
  
  protected ActionListener i()
  {
    int i = ec.t;
    ic localic = (ic)this.i;
    if (((i == 0) && (localic.r())) || ((i != 0) || ((localic.b()) || (localic.q())))) {
      new ActionListener()
      {
        public void actionPerformed(ActionEvent paramAnonymousActionEvent)
        {
          j.this.f("JTextFieldColorEditor.leftAlignedPopup".equals(paramAnonymousActionEvent.getActionCommand()));
        }
      };
    }
    new ActionListener()
    {
      public void actionPerformed(ActionEvent paramAnonymousActionEvent)
      {
        j.this.j();
      }
    };
  }
  
  void f(boolean paramBoolean)
  {
    a(this.p, paramBoolean);
  }
  
  void a(JComponent paramJComponent, boolean paramBoolean)
  {
    lb locallb = a(paramJComponent);
    JPopupMenu localJPopupMenu = locallb.c();
    if (ec.t == 0) {}
    int i = paramBoolean ? 0 : f().getWidth() - localJPopupMenu.getPreferredSize().width;
    localJPopupMenu.show(paramJComponent, i, paramJComponent.getHeight());
  }
  
  lb a(JComponent paramJComponent)
  {
    lb locallb = new lb((ic)this.i, paramJComponent, this.A);
    locallb.a(this);
    locallb.a((Color)n());
    return locallb;
  }
  
  void j()
  {
    c(this.p);
  }
  
  void c(JComponent paramJComponent)
  {
    Color localColor = wd.a(paramJComponent, "", (Color)n(), ic.b(this.i));
    if (localColor != null) {
      a(localColor);
    }
  }
  
  public void a(Object paramObject)
  {
    if (ec.t == 0) {
      if ((this.B != null) && ((paramObject instanceof Color))) {
        this.B.a((Color)paramObject);
      }
    }
    super.a(paramObject);
  }
  
  public void a(JPopupMenu paramJPopupMenu, Object paramObject)
  {
    a(paramObject);
    paramJPopupMenu.setVisible(false);
  }
  
  public void a() {}
  
  Color e(boolean paramBoolean)
  {
    return paramBoolean ? ad.a("TextField.background") : ad.a("TextField.inactiveBackground");
  }
  
  static j a(ic paramic, ob paramob)
  {
    bc localbc = a(paramic);
    HashMap localHashMap = new HashMap();
    localHashMap.put(pc.z, localbc);
    return new j(paramic, paramob, localHashMap, new c_(localbc, true));
  }
  
  static bc a(ic paramic)
  {
    return new bc(ic.b(paramic), ic.a(paramic));
  }
  
  static Class c(String paramString)
  {
    try
    {
      return Class.forName(paramString);
    }
    catch (ClassNotFoundException localClassNotFoundException)
    {
      throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
    }
  }
  
  static class c_
    extends JTextField
  {
    private final bc a;
    private final ab b;
    private final int c;
    
    c_(bc parambc, boolean paramBoolean)
    {
      super();
      this.a = parambc;
      a((Color)null);
      if (i == 0)
      {
        if (paramBoolean)
        {
          this.b = new ab(null);
          this.c = 3;
          Insets localInsets = getMargin();
          setMargin(new Insets(localInsets.top, this.c + 3 + this.b.getIconWidth(), localInsets.bottom, localInsets.right));
          if (i != 0) {
            return;
          }
          if (!ec.s) {}
        }
        else
        {
          this.b = null;
        }
      }
      else {
        this.c = 0;
      }
      setMinimumSize(new Dimension(Math.max(getMinimumSize().width, 40), getMinimumSize().height));
    }
    
    public void setText(String paramString)
    {
      if (ec.t == 0) {}
      a((Color)this.a.a(paramString, j.C == null ? (j.C = j.c("java.awt.Color")) : j.C));
    }
    
    void a(Color paramColor)
    {
      int i = ec.t;
      if (i == 0) {
        if (this.b != null) {
          this.b.a(paramColor);
        }
      }
      if (i == 0) {}
      super.setText(this.a.a(paramColor, j.C == null ? (j.C = j.c("java.awt.Color")) : j.C));
    }
    
    protected void paintComponent(Graphics paramGraphics)
    {
      super.paintComponent(paramGraphics);
      if ((ec.t != 0) || (this.b != null)) {
        this.b.paintIcon(this, paramGraphics, this.c, (getHeight() - this.b.getIconHeight()) / 2);
      }
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.h.j

 * JD-Core Version:    0.7.0.1

 */